from time import sleep

from selenium import webdriver
from selenium.webdriver.common.by import By
from common.base_page import BasePage

class UserSearch(BasePage):


    def __init__(self,driver):
        # self.driver=webdriver.Chrome()
        # self.driver=driver
        super().__init__(driver)
    search=(By.ID,'q')
    search_button=(By.LINK_TEXT,'搜索')


    def search_info(self,search_value):
        # self.driver.find_element(*self.search).clear()
        # self.driver.find_element(*self.search).send_keys(search_value)
        # self.driver.find_element(*self.search_button).click()
        self.clear(self.search,'搜索模块_搜索功能_清除操作')
        self.input(self.search,search_value,'搜索模块_搜索功能_清除操作')
        self.click(self.search_button,'搜索模块_搜索功能_清除操作')
        sleep(2)
        self.driver.back()



